package finalgame.Engine.pokemon;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Formatter;
import java.util.HashMap;
import java.util.Set;

import org.reflections.Reflections;

import finalgame.Game;
import finalgame.Engine.GeneratePokemon;

public class TestMain {
	public static void main(String[] args) {
		Reflections reflections = new Reflections("finalgame",
				Game.class.getClassLoader());
		Set<Class<? extends Pokemon>> classes = reflections
				.getSubTypesOf(Pokemon.class);
		int n = 0;
		for (Class<? extends Pokemon> clazz : classes) {
			String clazzName = clazz.getSimpleName();
			try {
				Constructor<? extends Pokemon> cons = clazz.getConstructor(Integer.TYPE);
				Pokemon p = (Pokemon) cons.newInstance(1);
				int i = clazz.getField("pokemonNumber").getInt(p);
				System.out.println(n++ + " " + clazzName + " " + i);
			} catch (IllegalArgumentException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			} catch (NoSuchFieldException e) {
				e.printStackTrace();
			} catch (SecurityException e) {
				e.printStackTrace();
			} catch (InstantiationException e) {
				e.printStackTrace();
			} catch (NoSuchMethodException e) {
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				e.printStackTrace();
			}
		}
	}

}
